// 笔试强训：倒置字符串

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main() {
    vector<string> s;
    string str;
    while(cin >> str)
    {
        s.push_back(str);
    }

    int n = s.size();
    for(int i = n - 1; i >= 0; --i)
    {
        cout << s[i] << " ";
    }
    cout << endl;
}